/**
 * @desc
 *  模板创建服务
 *
 * @使用场景
 *
 * @author  杨晓东[of1081]
 * @company qianmi.com
 * @Date    16/10/21
 **/
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments)).next());
    });
};
var fse = require("fs-extra");
var path = require('path');
function copyTemplateContent({ fromDir, toDir }) {
    return __awaiter(this, void 0, void 0, function* () {
        return new Promise((resolve, reject) => {
            fse.copy(fromDir, toDir, function (err) {
                if (err) {
                    reject(err);
                }
                else {
                    resolve();
                }
            });
        });
    });
}
exports.copyTemplateContent = copyTemplateContent;
//
// let fromDir = path.join(__dirname,'../template-files')
//      ,toDir  = path.join(__dirname,'../../x-ui/x-site-ui-article');
// copyTemplateContent({fromDir,toDir}); 
